package com.checkCode.keyName;

import org.springframework.stereotype.Component;

import java.util.UUID;

/**
 * @author 大忽悠
 * @create 2023/2/9 21:49
 */
@Component
public class UUIDKeyNameGenerator implements KeyNameGenerator{

    /**
     * @param prefix
     * @return 生成全局唯一的key作为验证码key
     */
    @Override
    public String generator(String prefix) {
        String uuid = UUID.randomUUID().toString();
        return prefix + uuid.replaceAll("-", "");
    }
}
